home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / amos / ldosv25d.lha / ldos_demo / examples / ldos / Devices.AMOS / Devices.amosSourceCode
AMOS Source Code  |  1992-04-26  |  3KB  |  139 lines

  1. '
  2. 'Examine the procedures for more information on how to use Ldev *
  3. '
  4. Erase 10 : Reserve As Work 10,30*4
  5. ST=Start(10)
  6. Screen Open 1,640,256,4,Hires
  7. Proc _SYSINFO
  8. A$= Extension_10_04F0(ST)
  9. Print "NAME: ";A$
  10. Proc MORE_INFO[ST]
  11. Centre "<<<Press A Key>>>" : Wait Key 
  12. Clw 
  13. Do 
  14.    A$= Extension_10_0502(ST)
  15.    Exit If A$=""
  16.    Print "NAME: ";A$
  17.    Proc MORE_INFO[ST]
  18.    Centre "<<<Press A Key>>>" : Wait Key 
  19.    Clw 
  20. Loop 
  21. Procedure MORE_INFO[ST]
  22.    'TS contains the following info: 
  23.    ' ST+0  = TYPE (0 "hard"-device, 1 assign, 2 volume  
  24.    ' ST+4  = UNIT number  
  25.    ' ST+8  = BSTR to devicename 
  26.    ' ST+12 = ENV tablesize
  27.    ' ST+16 = Blocksize (in longwords) 
  28.    ' ST+20 = *not used* 
  29.    ' ST+24 = number of heads
  30.    ' ST+28 = *not used* (always 1)
  31.    ' ST+32 = number of blocks per track 
  32.    ' ST+36 = number of DOS-reserved blocks (bootblocks) 
  33.    ' ST+40 = Not used (always 0)
  34.    ' ST+44 = Interleave 
  35.    ' ST+48 = low startcylinder
  36.    ' ST+52 = high endcylinder 
  37.    ' ST+56 = Number of DOS cachebuffers 
  38.    ' ST+60 = Buffmemtype
  39.    ' ST+64 = Maxtransfer
  40.    ' ST+68 = MASK (for DMA-devices) 
  41.    ' ST+72 = Bootpriority 
  42.    ' ST+76 = DOS-type (DOS0/DOS1 etc.)
  43.    '
  44.    TYPE=Leek(ST)
  45.    UNIT=Leek(ST+4)
  46.    ADR=Leek(ST+8)
  47.    L=Peek(ADR) : Rem BSTR-len 
  48.    Inc ADR : Dec L
  49.    If L>0
  50.       For I=0 To L
  51.          DNAME$=DNAME$+Chr$(Peek(ADR+I))
  52.       Next I
  53.    End If 
  54.    BLKSIZE=Leek(ST+16)*4
  55.    HEADS=Leek(ST+24)
  56.    BLKPTRACK=Leek(ST+32)
  57.    RESBLK=Leek(ST+36)
  58.    _INTERLEAVE=Leek(ST+44)
  59.    CYLLOW=Leek(ST+48)
  60.    CYLHI=Leek(ST+52)
  61.    BUFFERS=Leek(ST+56)
  62.    BUFFTYPE=Leek(ST+60)
  63.    _MAXT=Leek(ST+64)
  64.    MASK=Leek(ST+68)
  65.    BPRI=Leek(ST+72)
  66.    DTYPE=Leek(ST+76)
  67.    Print "DeviceType      : ";
  68.    If TYPE=0
  69.       Print "'Hard' device"
  70.    Else If TYPE=1
  71.          Print "Assignment"
  72.       Else If TYPE=2
  73.             Print "Volume"
  74.          End If 
  75.       End If 
  76.    End If 
  77.    Print "Devicename      : ";
  78.    If DNAME$=""
  79.       Print "N/A"
  80.    Else 
  81.       Print DNAME$-Chr$(0) : Rem Some name are and some not NULL-terminated 
  82.    End If 
  83.    Print "Disktype        : ";
  84.    If DTYPE=$444F5300
  85.       Print "Old filesystem"
  86.    Else If DTYPE=$444F5301
  87.          Print "New filesystem"
  88.       Else 
  89.          Print "N/A"
  90.       End If 
  91.    End If 
  92.    Print "Unit            : ";UNIT
  93.    Print "Number of heads : ";HEADS
  94.    Print "Blk per track   : ";BLKPTRACK
  95.    Print "Low  cylinder   : ";CYLLOW
  96.    Print "High cylinder   : ";CYLHI
  97.    Print "Reserved blocks : ";RESBLK
  98.    Print "Interleave      : ";_INTERLEAVE
  99.    Print "DOS buffers     : ";BUFFERS
  100.    Print "Buffmemtype     : ";BUFFTYPE
  101.    Print "MASK            : ";Hex$(MASK,8)
  102.    Print "Bootpri         : ";BPRI
  103. End Proc
  104. Procedure _SYSINFO
  105.    Print "List of system-assignments:"
  106.    ST=Start(10)
  107.    A$= Extension_10_04F0(ST)
  108.    Do 
  109.       Exit If A$=""
  110.       L=Leek(ST)
  111.       If L=1
  112.          Print A$
  113.       End If 
  114.       A$= Extension_10_0502(ST)
  115.    Loop 
  116.    Centre "<<<Press A Key>>>" : Wait Key : Clw 
  117.    Print "List of Volumes in system:"
  118.    A$= Extension_10_04F0(ST)
  119.    Do 
  120.       Exit If A$=""
  121.       L=Leek(ST)
  122.       If L=2
  123.          Print A$
  124.       End If 
  125.       A$= Extension_10_0502(ST)
  126.    Loop 
  127.    Centre "<<<Press A Key>>>" : Wait Key : Clw 
  128.    Print "List of connected devices:"
  129.    A$= Extension_10_04F0(ST)
  130.    Do 
  131.       Exit If A$=""
  132.       L=Leek(ST)
  133.       If L=0
  134.          Print A$
  135.       End If 
  136.       A$= Extension_10_0502(ST)
  137.    Loop 
  138.    Centre "<<<Press A Key>>>" : Wait Key : Clw 
  139. End Proc